// ============================== 导入依赖 ============================== //

import CORE from '@/CORE'

// ============================== 导出计算属性 ============================== //

export default {
  /**
   * 自定义计算属性 (可覆盖)
   */
  GETTER: ({ DICT: { TYPE = [], TARGET = [], TAB = [] }, one }) => {
    const type = CORE.dict(TYPE, one.planType)
    const target = CORE.dict(TARGET, one.planBizType)
    const canDeal = one.tab === TAB[0][0]
    const path = `device${one.tab}`
    const title = CORE.dict(TYPE, one.planType)
    const STATUS = TAB.map(([code, name, , color]) => [+code, `${name.slice(0, 1)}${title}`, '', color])

    return { type, target, canDeal, path, title, STATUS }
  },
}
